//
//  TONewFriendMessageCell.m
//  IMChat
//
//  Created by Admin on 2021/7/3.
//  Copyright © 2021年 TeamOne. All rights reserved.
//

#import "TONewFriendMessageCell.h"

@interface TONewFriendMessageCell()

@property (copy, nonatomic) IBOutlet UIImageView *sourceHeadImage;

@property (strong, nonatomic) IBOutlet UILabel *sourceId;

@property (copy, nonatomic) IBOutlet UILabel *message;

@property (copy, nonatomic) IBOutlet UIButton *AcceptBtn;

@property (copy, nonatomic) IBOutlet UIButton *RejectBtn;

@property (copy, nonatomic) IBOutlet UILabel *Result;

@end

@implementation TONewFriendMessageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellId = @"cellID";
    //到缓存池中找cell，没有再创建并加入缓存池
    TONewFriendMessageCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil) {
        cell = [[TONewFriendMessageCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
    }
    return cell;
}

- (id)initWithStyle:(UITableViewCellStyle)style
    reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        
        _sourceHeadImage = [[UIImageView alloc]init];
        _sourceHeadImage.frame = CGRectMake(0, 0, 50, 50);
        [self.contentView addSubview:_sourceHeadImage];
        //self.sourceHeadImage = _sourceHeadImage;
        
        _sourceId = [[UILabel alloc]init];
        _sourceId.frame = CGRectMake(0, 0, 20, 100);
        [self.contentView addSubview:_sourceId];
        //self.sourceId = _sourceId;
        
        UILabel *message = [[UILabel alloc]init];
        message.frame = CGRectMake(0, 0, 20, 100);
        message.text = @"加好友～";
        [self.contentView addSubview:message];
        //self.message = message;
        
        _AcceptBtn = [[UIButton alloc]init];
        _AcceptBtn.frame = CGRectMake(0, 0, 30, 50);
        [_AcceptBtn setTitle:@"同意" forState:UIControlStateNormal];
        [self.contentView addSubview:_AcceptBtn];
        //self.AcceptBtn = _AcceptBtn;
        
        _RejectBtn = [[UIButton alloc]init];
        [_RejectBtn setTitle:@"拒绝" forState:UIControlStateNormal];
        _RejectBtn.frame = CGRectMake(0, 0, 30, 50);
        [self.contentView addSubview:_RejectBtn];
        //self.RejectBtn = _RejectBtn;
        
        //[self.contentView addSubview:_Result];
        //self.Result = _Result;
    }
    
    return self;
}

- (void)setSourceId:(NSString *)sourceIdText{
    [_sourceId setText:sourceIdText];
}

- (void)setMessageText:(NSString *)messageText{
    _message.text = messageText;
}

@end
